import time
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By

from lx2.Page1 import Page1
class Test_Case(unittest.TestCase):
    def setUp(self):
        self.driver=webdriver.Edge()
        self.driver.maximize_window()
        self.driver.implicitly_wait(5)

    def tearDown(self):
        time.sleep(10)
        self.driver.quit()

    def test_jiuxian_01(self):
        po=Page1(self.driver)
        po.open_url('https://www.jiuxian.com/')
        po.login()

        po.username()
        po.password()
        time.sleep(10)
        po.loginbtn()
        po.accept()
        # 断言
        logintext=self.driver.find_element(By.XPATH,'/html/body/div[2]/div/div[1]/div/p/span').text
        self.assertEqual('jxw627748426',logintext)
        print(logintext)


if __name__ == '__main__':
    unittest.main()
